<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>政务大数据共享交换平台</title>
    <!-- 新增网站图标配置 -->
    <link rel="icon" href="{{ url_for('static', filename='images/favicon.ico') }}">
    <script src="{{ url_for('static', filename='qd/js/jquery.min.js') }}"></script>
    <script src="{{ url_for('static', filename='qd/js/echarts.min.js') }}"></script>
</head>
<body>
<div class="container-header">
    <ul class="nowTime">
        <li></li>
        <li></li>
    </ul>
    <div class="location">
        <i class="icon iconfont icon-buoumaotubiao23"></i>
        <span class="areaName"></span>
    </div>
    <h3>海口市景点数据实时平台</h3>
</div>
<div class="container-content">
    <div class="top">
		<div class="count-base" >
			<div class="com-count-title">资源总量构成</div>
			<div class="com-screen-content">

				<div id="main1" style="width:100%;height:300px;"></div>
			</div>
			<span class="left-top"></span>
			<span class="right-top"></span>
			<span class="left-bottom"></span>
			<span class="right-bottom"></span>
		</div>
		<div class="count-resource q1">
			<div class="com-count-title">资源总量统计</div>
			<div class="com-screen-content2">
				<ul class="use-data">
					<li>
						<p class="data-count">15681 </p>
						<span class="data-name">数据总量</span>
					</li>
					<li>
						<p class="data-count"> 1731</p>
						<span class="data-name">更新量</span>
					</li>
					<li>
						<p class="data-count">11753</p>
						<span class="data-name">共享次数</span>
					</li>
				</ul>
				<div class="com-screen-content">
				 <div id="main2" style="margin-top:10px;width:100%;height:240px;"></div>
				</div>
				<span class="left-top"></span>
				<span class="right-top"></span>
				<span class="left-bottom"></span>
				<span class="right-bottom"></span>
			</div>
		</div>
		<div class="count-resource q2">
			<div class="com-count-title">基础库统计</div>


			<div class="com-screen-content">
				<ul class="data-label">
					<li class="active" data-type="1">法人库</li>
					<li data-type="2">人口库</li>
					<li data-type="3">电子证照库</li>
				</ul>
				<ul class="use-data">

				</ul>
			 <div id="main3" style="margin-top:10px;width:100%;height:240px;"></div>
			</div>
			<span class="left-top"></span>
			<span class="right-top"></span>
			<span class="left-bottom"></span>
			<span class="right-bottom"></span>
		</div>
    </div>

	<div class="mid">
		<div class="count-share w1" >
			<div class="com-count-title">数据共享次数</div>
			<div class="com-screen-content">
				    <div class="topRec_List">
						<dl>
							<dd>资源名称</dd>
							<dd>调用方</dd>
							<dd>调用时间</dd>
						</dl>
						<div class="maquee">
							<ul>
								<li>
									<div>审计局主要职责</div>
									<div>审计局</div>
									<div>08:20:26 </div>
								</li>
								<li>

									<div>残联主要职责</div>
									<div>残联</div>
									<div>08:20:36 </div>
								</li>
								<li>

									<div>委老干部局主要职责</div>
									<div>老干部局</div>
									<div>08:20:46 </div>
								</li>
								<li>
									<div>公安局主要职责</div>
									<div>公安局</div>
									<div>08:20:56</div>
								</li>
								<li>
									<div>更多精美大屏</div>
									<div>关注公众号</div>
									<div>DreamCoders</div>
								</li>
								<li>
									<div>交通运输局主要职责</div>
									<div>完全免费分享</div>
									<div>08:21:07</div>
								</li>
							</ul>
						</div>
					</div>
			</div>
			<span class="left-top"></span>
			<span class="right-top"></span>
			<span class="left-bottom"></span>
			<span class="right-bottom"></span>
		</div>
		<div class="count-share w2" >
			<div class="com-count-title">数据共享次数</div>
			<div class="com-screen-content">
			 <div id="main5" style="width:100%;height:300px;"></div>
			</div>
			<span class="left-top"></span>
			<span class="right-top"></span>
			<span class="left-bottom"></span>
			<span class="right-bottom"></span>
		</div>
	</div>

	<div class="bottom">
		<div class="count-topic e1" >
			<div class="com-count-title">主题库统计</div>
			<div class="com-screen-content">
			<div id="main6" style="width:100%;height:300px;"></div>
			</div>
			<span class="left-top"></span>
			<span class="right-top"></span>
			<span class="left-bottom"></span>
			<span class="right-bottom"></span>
		</div>
		<div class="count-topic e2" >
			<div class="com-count-title">主题库共享次数</div>
			<div class="com-screen-content">
			 <div id="main7" style="width:100%;height:300px;"></div>
			</div>
			<span class="left-top"></span>
			<span class="right-top"></span>
			<span class="left-bottom"></span>
			<span class="right-bottom"></span>
		</div>
	</div>
	<div class="clearfix"></div>
</div>

<script type="text/javascript">
//根据不同的分辨率调用不同的css和js
	if(window.screen.width>=1600){
		document.write("<link href='{{ url_for('static', filename='qd/css/test-1920.css') }}' rel='stylesheet' type='text/css'>");
		document.writeln("<script type=\"text/javascript\" src=\"{{ url_for('static', filename='qd/js/test-1920.js') }}\"><\/script>");
	}
	else if(window.screen.width<1600&&window.screen.width>=1280){
		document.write("<link href='{{ url_for('static', filename='qd/css/test-1280.css') }}' rel='stylesheet' type='text/css'>");
		document.writeln("<script type=\"text/javascript\" src=\"{{ url_for('static', filename='qd/js/test-1280.js') }}\"><\/script>");
	}else{
	document.write("<link href='{{ url_for('static', filename='qd/css/test-1024.css') }}' rel='stylesheet' type='text/css'>");
		document.writeln("<script type=\"text/javascript\" src=\"{{ url_for('static', filename='qd/js/test-1024.js') }}\"><\/script>");
	}
</script>
<!--大屏-->
<script type="text/javascript">
	  function autoScroll(obj){
			$(obj).find("ul").animate({
				marginTop : "-39px"
			},500,function(){  
				$(this).css({marginTop : "0px"}).find("li:first").appendTo(this);
			})
		}
		$(function(){
			setInterval('autoScroll(".maquee")',2000);
		})
</script>
<script type="text/javascript">
    // 动态加载实时数据
    function loadRealtimeData() {
        fetch('/update_data')
            .then(response => response.json())
            .then(data => {
                // 更新资源总量统计
                document.querySelector('.use-data li:nth-child(1) .data-count').textContent = data.totalResources;
                document.querySelector('.use-data li:nth-child(2) .data-count').textContent = data.updateCount;
                document.querySelector('.use-data li:nth-child(3) .data-count').textContent = data.shareCount;

                // 更新资源总量构成图表
                const chart1 = echarts.init(document.getElementById('main1'));
                chart1.setOption({
                    series: [{
                        type: 'pie',
                        data: data.resourceComposition
                    }]
                });

                // 更新资源总量统计图表
                const chart2 = echarts.init(document.getElementById('main2'));
                chart2.setOption({
                    series: [{
                        type: 'bar',
                        data: data.resourceStatistics
                    }]
                });
            })
            .catch(error => console.error('加载实时数据失败:', error));
    }

    // 页面加载时调用
    window.onload = function() {
        loadRealtimeData();
    };
</script>

</body>
</html>